<?php
class Page extends AppModel{
	//$this->loadModel('Menu');
	
	public $validate = array(
		'title' => array(
			'rule'     => 'notEmpty',
			'required' => true,
			'message' => 'Title field is required.'
		)
	);
	
	public $title ="";
	public function isOwnedBy($page, $user) {
		
		return $this->field('id', array('id' => $page, 'user_id' => $user)) === $page;
	}
	
	function find_menu($menu_id){
		$menu_info = $this->query("select * from menus where id='".$menu_id."'");
		return $menu_info;
	}
}

?>